<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.w3.org/1999/xhtml" layout:decorator="layout">
<head th:include="layout :: htmlhead" th:with="title='favorites'"></head>
<body>
<scetion layout:fragment="content">
    <div class="main layui-clear">
        <div class="wrap">
            <div class="content">
                <div class="fly-tab fly-tab-index">
        <span>
          <a href="jie/index.html">全部</a>
          <a href="jie/index.html">未结帖</a>
          <a href="jie/index.html">已采纳</a>
          <a href="jie/index.html">精帖</a>
          <a href="user/index.html">我的帖</a>
        </span>
                    <form action="http://cn.bing.com/search" class="fly-search">
                        <i class="iconfont icon-sousuo"></i>
                        <input class="layui-input" autocomplete="off" placeholder="搜索内容，回车跳转" type="text" name="q"/>
                    </form>
                    <a href="jie/add.html" class="layui-btn jie-add">发布问题</a>
                </div>


                <ul class="fly-list fly-list-top">
                    <li class="fly-list-li">
                        <a href="user/home.html" class="fly-list-avatar">
                            <img src="http://tp4.sinaimg.cn/1345566427/180/5730976522/0" alt=""/>
                        </a>
                        <h2 class="fly-tip">
                            <a href="jie/detail.html">基于 layui的轻量级问答社区页面模版 V2版本</a>
                            <span class="fly-tip-stick">置顶</span>
                            <span class="fly-tip-jing">精帖</span>
                        </h2>
                        <p>
                            <span><a href="user/home.html">贤心</a></span>
                            <span>刚刚</span>
                            <span>layui框架综合</span>
                            <span class="fly-list-hint">
              <i class="iconfont" title="回答">&#xe60c;</i> 317
              <i class="iconfont" title="人气">&#xe60b;</i> 6830
            </span>
                        </p>
                    </li>
                    <li class="fly-list-li">
                        <a href="user/home.html" class="fly-list-avatar">
                            <img src="../res/images/avatar/00.jpg" alt=""/>
                        </a>
                        <h2 class="fly-tip">
                            <a href="jie/detail.html">基于 layui的轻量级问答社区页面模版 V2版本</a>
                            <span class="fly-tip-stick">置顶</span>
                        </h2>
                        <p>
                            <span><a href="user/home.html">纸飞机</a></span>
                            <span>30分钟前</span>
                            <span>技术闲谈</span>
                            <span class="fly-list-hint">
              <i class="iconfont" title="回答">&#xe60c;</i> 502
              <i class="iconfont" title="人气">&#xe60b;</i> 81689
            </span>
                        </p>
                    </li>
                </ul>

                <ul class="fly-list">
                    <li class="fly-list-li">
                        <a href="user/home.html" class="fly-list-avatar">
                            <img src="../res/images/avatar/default.png" alt=""/>
                        </a>
                        <h2 class="fly-tip">
                            <a href="jie/detail.html">关于layui 引用其他插件，扩展模块 的用法</a>
                        </h2>
                        <p>
                            <span><a href="user/home.html">用户昵称</a></span>
                            <span>1小时前</span>
                            <span>layui框架综合</span>
                            <span class="fly-list-hint">
              <i class="iconfont" title="回答">&#xe60c;</i> 8
              <i class="iconfont" title="人气">&#xe60b;</i> 106
            </span>
                        </p>
                    </li>
                    <li class="fly-list-li">
                        <a href="user/home.html" class="fly-list-avatar">
                            <img src="../res/images/avatar/default.png" alt=""/>
                        </a>
                        <h2 class="fly-tip">
                            <a href="jie/detail.html">关于layui 引用其他插件，扩展模块 的用法</a>
                        </h2>
                        <p>
                            <span><a href="user/home.html">用户昵称</a></span>
                            <span>1小时前</span>
                            <span>layui框架综合</span>
                            <span class="fly-list-hint">
              <i class="iconfont" title="回答">&#xe60c;</i> 8
              <i class="iconfont" title="人气">&#xe60b;</i> 106
            </span>
                        </p>
                    </li>
                    <li class="fly-list-li">
                        <a href="user/home.html" class="fly-list-avatar">
                            <img src="../res/images/avatar/default.png" alt=""/>
                        </a>
                        <h2 class="fly-tip">
                            <a href="jie/detail.html">关于layui 引用其他插件，扩展模块 的用法</a>
                        </h2>
                        <p>
                            <span><a href="user/home.html">用户昵称</a></span>
                            <span>1小时前</span>
                            <span>layui框架综合</span>
                            <span class="fly-list-hint">
              <i class="iconfont" title="回答">&#xe60c;</i> 8
              <i class="iconfont" title="人气">&#xe60b;</i> 106
            </span>
                        </p>
                    </li>
                    <li class="fly-list-li">
                        <a href="user/home.html" class="fly-list-avatar">
                            <img src="../res/images/avatar/default.png" alt=""/>
                        </a>
                        <h2 class="fly-tip">
                            <a href="jie/detail.html">关于layui 引用其他插件，扩展模块 的用法</a>
                        </h2>
                        <p>
                            <span><a href="user/home.html">用户昵称</a></span>
                            <span>1小时前</span>
                            <span>layui框架综合</span>
                            <span class="fly-list-hint">
              <i class="iconfont" title="回答">&#xe60c;</i> 8
              <i class="iconfont" title="人气">&#xe60b;</i> 106
            </span>
                        </p>
                    </li>
                    <li class="fly-list-li">
                        <a href="user/home.html" class="fly-list-avatar">
                            <img src="../res/images/avatar/default.png" alt=""/>
                        </a>
                        <h2 class="fly-tip">
                            <a href="jie/detail.html">关于layui 引用其他插件，扩展模块 的用法</a>
                        </h2>
                        <p>
                            <span><a href="user/home.html">用户昵称</a></span>
                            <span>1小时前</span>
                            <span>layui框架综合</span>
                            <span class="fly-list-hint">
              <i class="iconfont" title="回答">&#xe60c;</i> 8
              <i class="iconfont" title="人气">&#xe60b;</i> 106
            </span>
                        </p>
                    </li>
                    <li class="fly-list-li">
                        <a href="user/home.html" class="fly-list-avatar">
                            <img src="../res/images/avatar/default.png" alt=""/>
                        </a>
                        <h2 class="fly-tip">
                            <a href="jie/detail.html">关于layui 引用其他插件，扩展模块 的用法</a>
                        </h2>
                        <p>
                            <span><a href="user/home.html">用户昵称</a></span>
                            <span>1小时前</span>
                            <span>layui框架综合</span>
                            <span class="fly-list-hint">
              <i class="iconfont" title="回答">&#xe60c;</i> 8
              <i class="iconfont" title="人气">&#xe60b;</i> 106
            </span>
                        </p>
                    </li>
                    <li class="fly-list-li">
                        <a href="user/home.html" class="fly-list-avatar">
                            <img src="../res/images/avatar/default.png" alt=""/>
                        </a>
                        <h2 class="fly-tip">
                            <a href="jie/detail.html">关于layui 引用其他插件，扩展模块 的用法</a>
                        </h2>
                        <p>
                            <span><a href="user/home.html">用户昵称</a></span>
                            <span>1小时前</span>
                            <span>layui框架综合</span>
                            <span class="fly-list-hint">
              <i class="iconfont" title="回答">&#xe60c;</i> 8
              <i class="iconfont" title="人气">&#xe60b;</i> 106
            </span>
                        </p>
                    </li>
                    <li class="fly-list-li">
                        <a href="user/home.html" class="fly-list-avatar">
                            <img src="../res/images/avatar/default.png" alt=""/>
                        </a>
                        <h2 class="fly-tip">
                            <a href="jie/detail.html">关于layui 引用其他插件，扩展模块 的用法</a>
                        </h2>
                        <p>
                            <span><a href="user/home.html">用户昵称</a></span>
                            <span>1小时前</span>
                            <span>layui框架综合</span>
                            <span class="fly-list-hint">
              <i class="iconfont" title="回答">&#xe60c;</i> 8
              <i class="iconfont" title="人气">&#xe60b;</i> 106
            </span>
                        </p>
                    </li>
                    <li class="fly-list-li">
                        <a href="user/home.html" class="fly-list-avatar">
                            <img src="../res/images/avatar/default.png" alt=""/>
                        </a>
                        <h2 class="fly-tip">
                            <a href="jie/detail.html">关于layui 引用其他插件，扩展模块 的用法</a>
                        </h2>
                        <p>
                            <span><a href="user/home.html">用户昵称</a></span>
                            <span>1小时前</span>
                            <span>layui框架综合</span>
                            <span class="fly-list-hint">
              <i class="iconfont" title="回答">&#xe60c;</i> 8
              <i class="iconfont" title="人气">&#xe60b;</i> 106
            </span>
                        </p>
                    </li>
                    <li class="fly-list-li">
                        <a href="user/home.html" class="fly-list-avatar">
                            <img src="../res/images/avatar/default.png" alt=""/>
                        </a>
                        <h2 class="fly-tip">
                            <a href="jie/detail.html">关于layui 引用其他插件，扩展模块 的用法</a>
                        </h2>
                        <p>
                            <span><a href="user/home.html">用户昵称</a></span>
                            <span>1小时前</span>
                            <span>layui框架综合</span>
                            <span class="fly-list-hint">
              <i class="iconfont" title="回答">&#xe60c;</i> 8
              <i class="iconfont" title="人气">&#xe60b;</i> 106
            </span>
                        </p>
                    </li>
                    <li class="fly-list-li">
                        <a href="user/home.html" class="fly-list-avatar">
                            <img src="../res/images/avatar/default.png" alt=""/>
                        </a>
                        <h2 class="fly-tip">
                            <a href="jie/detail.html">关于layui 引用其他插件，扩展模块 的用法</a>
                        </h2>
                        <p>
                            <span><a href="user/home.html">用户昵称</a></span>
                            <span>1小时前</span>
                            <span>layui框架综合</span>
                            <span class="fly-list-hint">
              <i class="iconfont" title="回答">&#xe60c;</i> 8
              <i class="iconfont" title="人气">&#xe60b;</i> 106
            </span>
                        </p>
                    </li>
                    <li class="fly-list-li">
                        <a href="user/home.html" class="fly-list-avatar">
                            <img src="/images/avatar/default.png" alt=""/>
                        </a>
                        <h2 class="fly-tip">
                            <a href="jie/detail.html">关于layui 引用其他插件，扩展模块 的用法</a>
                        </h2>
                        <p>
                            <span><a href="user/home.html">用户昵称</a></span>
                            <span>1小时前</span>
                            <span>layui框架综合</span>
                            <span class="fly-list-hint">
              <i class="iconfont" title="回答">&#xe60c;</i> 8
              <i class="iconfont" title="人气">&#xe60b;</i> 106
            </span>
                        </p>
                    </li>
                    <li class="fly-list-li">
                        <a href="user/home.html" class="fly-list-avatar">
                            <img src="../res/images/avatar/default.png" alt=""/>
                        </a>
                        <h2 class="fly-tip">
                            <a href="jie/detail.html">关于layui 引用其他插件，扩展模块 的用法</a>
                        </h2>
                        <p>
                            <span><a href="user/home.html">用户昵称</a></span>
                            <span>1小时前</span>
                            <span>layui框架综合</span>
                            <span class="fly-list-hint">
              <i class="iconfont" title="回答">&#xe60c;</i> 8
              <i class="iconfont" title="人气">&#xe60b;</i> 106
            </span>
                        </p>
                    </li>
                    <li class="fly-list-li">
                        <a href="user/home.html" class="fly-list-avatar">
                            <img src="../res/images/avatar/default.png" alt=""/>
                        </a>
                        <h2 class="fly-tip">
                            <a href="jie/detail.html">关于layui 引用其他插件，扩展模块 的用法</a>
                        </h2>
                        <p>
                            <span><a href="user/home.html">用户昵称</a></span>
                            <span>1小时前</span>
                            <span>layui框架综合</span>
                            <span class="fly-list-hint">
              <i class="iconfont" title="回答">&#xe60c;</i> 8
              <i class="iconfont" title="人气">&#xe60b;</i> 106
            </span>
                        </p>
                    </li>
                    <li class="fly-list-li">
                        <a href="user/home.html" class="fly-list-avatar">
                            <img src="../res/images/avatar/default.png" alt=""/>
                        </a>
                        <h2 class="fly-tip">
                            <a href="jie/detail.html">关于layui 引用其他插件，扩展模块 的用法</a>
                        </h2>
                        <p>
                            <span><a href="user/home.html">用户昵称</a></span>
                            <span>1小时前</span>
                            <span>layui框架综合</span>
                            <span class="fly-list-hint">
              <i class="iconfont" title="回答">&#xe60c;</i> 8
              <i class="iconfont" title="人气">&#xe60b;</i> 106
            </span>
                        </p>
                    </li>
                </ul>

                <div style="text-align: center">
                    <div class="laypage-main">
                        <a href="jie/index.html" class="laypage-next">更多求解</a>
                    </div>
                </div>

            </div>
        </div>

        <div class="edge">
            <div class="fly-panel leifeng-rank">
                <h3 class="fly-panel-title">近一月回答榜 - TOP 12</h3>
                <dl>
                    <dd>
                        <a href="user/home.html">
                            <img src="../res/images/avatar/default.png"/>
                            <cite>纸飞机</cite>
                            <i>159次回答</i>
                        </a>
                    </dd>
                    <dd>
                        <a href="user/home.html">
                            <img src="../res/images/avatar/default.png"/>
                            <cite>纸飞机</cite>
                            <i>159次回答</i>
                        </a>
                    </dd>
                    <dd>
                        <a href="user/home.html">
                            <img src="../res/images/avatar/default.png"/>
                            <cite>纸飞机</cite>
                            <i>159次回答</i>
                        </a>
                    </dd>
                    <dd>
                        <a href="user/home.html">
                            <img src="../res/images/avatar/default.png"/>
                            <cite>纸飞机</cite>
                            <i>159次回答</i>
                        </a>
                    </dd>
                    <dd>
                        <a href="user/home.html">
                            <img src="../res/images/avatar/default.png"/>
                            <cite>纸飞机</cite>
                            <i>159次回答</i>
                        </a>
                    </dd>
                    <dd>
                        <a href="user/home.html">
                            <img src="../res/images/avatar/default.png"/>
                            <cite>纸飞机</cite>
                            <i>159次回答</i>
                        </a>
                    </dd>
                    <dd>
                        <a href="user/home.html">
                            <img src="../res/images/avatar/default.png"/>
                            <cite>纸飞机</cite>
                            <i>159次回答</i>
                        </a>
                    </dd>
                    <dd>
                        <a href="user/home.html">
                            <img src="../res/images/avatar/default.png"/>
                            <cite>纸飞机</cite>
                            <i>159次回答</i>
                        </a>
                    </dd>
                    <dd>
                        <a href="user/home.html">
                            <img src="../res/images/avatar/default.png"/>
                            <cite>纸飞机</cite>
                            <i>159次回答</i>
                        </a>
                    </dd>
                    <dd>
                        <a href="user/home.html">
                            <img src="../res/images/avatar/default.png"/>
                            <cite>纸飞机</cite>
                            <i>159次回答</i>
                        </a>
                    </dd>
                    <dd>
                        <a href="user/home.html">
                            <img src="../res/images/avatar/default.png"/>
                            <cite>纸飞机</cite>
                            <i>159次回答</i>
                        </a>
                    </dd>
                    <dd>
                        <a href="user/home.html">
                            <img src="../res/images/avatar/default.png"/>
                            <cite>纸飞机</cite>
                            <i>159次回答</i>
                        </a>
                    </dd>
                </dl>
            </div>

            <dl class="fly-panel fly-list-one">
                <dt class="fly-panel-title">最近热帖</dt>
                <dd>
                    <a href="jie/detail.html">使用 layui 秒搭后台大布局（基本结构）</a>
                    <span><i class="iconfont">&#xe60b;</i> 6087</span>
                </dd>
                <dd>
                    <a href="jie/detail.html">Java实现LayIM后端的核心代码</a>
                    <span><i class="iconfont">&#xe60b;</i> 767</span>
                </dd>
                <dd>
                    <a href="jie/detail.html">使用 layui 秒搭后台大布局（基本结构）</a>
                    <span><i class="iconfont">&#xe60b;</i> 6087</span>
                </dd>
                <dd>
                    <a href="jie/detail.html">Java实现LayIM后端的核心代码</a>
                    <span><i class="iconfont">&#xe60b;</i> 767</span>
                </dd>
                <dd>
                    <a href="jie/detail.html">使用 layui 秒搭后台大布局（基本结构）</a>
                    <span><i class="iconfont">&#xe60b;</i> 6087</span>
                </dd>
                <dd>
                    <a href="jie/detail.html">Java实现LayIM后端的核心代码</a>
                    <span><i class="iconfont">&#xe60b;</i> 767</span>
                </dd>
                <dd>
                    <a href="jie/detail.html">使用 layui 秒搭后台大布局（基本结构）</a>
                    <span><i class="iconfont">&#xe60b;</i> 6087</span>
                </dd>
                <dd>
                    <a href="jie/detail.html">Java实现LayIM后端的核心代码</a>
                    <span><i class="iconfont">&#xe60b;</i> 767</span>
                </dd>
            </dl>

            <dl class="fly-panel fly-list-one">
                <dt class="fly-panel-title">近期热议</dt>
                <dd>
                    <a href="jie/detail.html">使用 layui 秒搭后台大布局之基本结构</a>
                    <span><i class="iconfont">&#xe60c;</i> 96</span>
                </dd>
                <dd>
                    <a href="jie/detail.html">使用 layui 秒搭后台大布局之基本结构</a>
                    <span><i class="iconfont">&#xe60c;</i> 96</span>
                </dd>
                <dd>
                    <a href="jie/detail.html">使用 layui 秒搭后台大布局之基本结构</a>
                    <span><i class="iconfont">&#xe60c;</i> 96</span>
                </dd>
                <dd>
                    <a href="jie/detail.html">使用 layui 秒搭后台大布局之基本结构</a>
                    <span><i class="iconfont">&#xe60c;</i> 96</span>
                </dd>
                <dd>
                    <a href="jie/detail.html">使用 layui 秒搭后台大布局之基本结构</a>
                    <span><i class="iconfont">&#xe60c;</i> 96</span>
                </dd>
                <dd>
                    <a href="jie/detail.html">使用 layui 秒搭后台大布局之基本结构</a>
                    <span><i class="iconfont">&#xe60c;</i> 96</span>
                </dd>
                <dd>
                    <a href="jie/detail.html">使用 layui 秒搭后台大布局之基本结构</a>
                    <span><i class="iconfont">&#xe60c;</i> 96</span>
                </dd>
                <dd>
                    <a href="jie/detail.html">使用 layui 秒搭后台大布局之基本结构</a>
                    <span><i class="iconfont">&#xe60c;</i> 96</span>
                </dd>
            </dl>

            <div class="fly-panel fly-link">
                <h3 class="fly-panel-title">友情链接</h3>
                <dl>
                    <dd>
                        <a href="http://www.layui.com/" target="_blank">layui</a>
                    </dd>
                    <dd>
                        <a href="http://layim.layui.com/" target="_blank">LayIM</a>
                    </dd>
                    <dd>
                        <a href="http://layer.layui.com/" target="_blank">layer</a>
                    </dd>
                </dl>
            </div>


        </div>
    </div>
    <script th:inline="javascript">
        //<![CDATA[
        layui.use(['layim','socket','req'], function(layim,socket,req){
            var $ =layui.jquery;
            var selfFlag = false;
            //基础配置
            layim.config({
                //初始化接口
                init: {
                    url: '/layim/base'
                }
                //查看群员接口
                ,members: {
                    url: '/layim/members'
                }
                //上传图片接口
                ,uploadImage: {url: '/upload/file'}
                //上传文件接口
                ,uploadFile: {url: '/upload/file'}

                ,isAudio: true //开启聊天工具栏音频
                ,isVideo: true //开启聊天工具栏视频
                ,initSkin: '5.jpg' //1-5 设置初始背景
                ,notice: true //是否开启桌面消息提醒，默认false
                ,msgbox: '/layim/msgbox'
                ,find: layui.cache.dir + 'css/modules/layim/html/find.html' //发现页面地址，若不开启，剔除该项即可
                ,chatLog: layui.cache.dir + 'css/modules/layim/html/chatLog.html' //聊天记录页面地址，若不开启，剔除该项即可

            });
            socket.config({
                log:true,
                token:'/layim/token',
                server:'ws://127.0.0.1:8888'
            });

            socket.on('open',function (e) {
                console.log("监听到事件：open");
            });
            socket.on('close',function (e) {
                console.log("监听到事件：close");
            });
            socket.on('error',function (e) {
                console.log("监听到事件：error");
            });
            socket.on('msg',function (e) {
                var msg = JSON.parse(e.data);
                console.log(msg);
                var handleChat = function (msg) {
                    if (selfFlag) {
                        selfFlag = false;
                        return;
                    }
                    layim.getMessage(msg);
                }
                var handleStatus=function (msg) {
                    var status ='';
                    if(typeof msg.count !== 'undefined'){
                        status = msg.count+'人在线';
                    }else{
                        status = msg.online?'在线':'离线';
                    }
                    layim.setChatStatus('<span style="color:#FF5722;">'+status+'</span>');
                }
                if (msg.mtype) {
                    switch (msg.mtype) {
                        case -1:
                            return console.log(msg.msg);
                        case socket.mtype.chatFriend:
                        case socket.mtype.chatGroup:
                            handleChat(msg);
                            break;
                        case socket.mtype.checkIsOnline:
                        case socket.mtype.checkOnlineCount:
                            handleStatus(msg);
                            break;
                        case socket.mtype.serverNotice:
                            layim.msgbox(msg.count);
                            break;
                        case socket.mtype.addFriendNotice:
                            layim.addList({
                               type:msg.type,
                               avatar:msg.avatar,
                               username:msg.username,
                               groupid:msg.groupid,
                               sign:msg.sign,
                               id:msg.id
                            });
                            msg.mtype=socket.mtype.chatFriend;
                            msg.content="我们已经是好友啦，一起来聊天吧！";
                            layim.getMessage(msg);
                            break;
                        case socket.mtype.onofflineNotice:
                            layim.setFriendStatus(msg.id,msg.status);
                            break;
                    }
                }
            });
            console.log(socket.mtype);

            //监听在线状态的切换事件
            layim.on('online', function(data){
                //console.log(data);
            });
            //监听签名修改
            layim.on('sign', function(value){
                //console.log(value);
            });
            //监听自定义工具栏点击，以添加代码为例
            layim.on('tool(code)', function(insert){
                layer.prompt({
                    title: '插入代码'
                    ,formType: 2
                    ,shade: 0
                }, function(text, index){
                    layer.close(index);
                    insert('[pre class=layui-code]' + text + '[/pre]'); //将内容插入到编辑器
                });
            });
            //监听layim建立就绪
            layim.on('ready', function(){
                req.loading = false;
                req.get('/layim/apply-unread',{},function (res) {
                    res.data&&layim.msgbox(res.data);
                });
              console.log(layim.cache().friend);
            });
            //监听发送消息
            layim.on('sendMessage', function(data){
                var To = data.to;
                var t = data.to.type=='friend';
                if(!t){
                    selfFlag = true;
                }
                socket.send({mtype:(t?socket.mtype.chatFriend:socket.mtype.chatGroup),content:data.mine.content,toid:data.to.id});
                return;
            });
            //监听查看群员
            layim.on('members', function(data){
                //console.log(data);
            });
            //监听天窗口的切换
            layim.on('chatChange', function(res){
                var t = res.data.type=='friend';
                socket.send({
                    mtype:t? socket.mtype.checkIsOnline:socket.mtype.checkOnlineCount,
                    id:res.data.id
                });
            });
        });
        //]]>
    </script>
</scetion>

</body>

</html>